<template>
  <div>
    <MkQueryContainer>
      <template #header="">
        <MkForm ref="queryForm" :model="searchParam" :inline="true" :col="4">
          <MkInput label="关键字" @keyup.enter.native="search" v-model="searchParam.keyword" clearable="" />
          <MkDatePicker label="开单时间" v-model="searchParam.startTime" />
          <MkDatePicker label="至" v-model="searchParam.endTime" />
          <el-form-item>
            <MkButtonQuery @click="search"> </MkButtonQuery>
          </el-form-item>
        </MkForm>
      </template>
      <MkTable :data="tableData" v-loading="loading" @row-dblclick="edit">
        <MkColumnIndex />
        <MkColumn prop="id" label="单据号" />
        <MkColumn prop="danJuZhuangTai" label="单据状态" width="80px" />
        <MkColumn prop="huanZheId" label="患者Id" width="80px" />
        <MkColumn prop="xingMing" label="患者姓名" width="80px" />
        <MkColumn prop="keShiId" label="申请科室" />
        <MkColumn prop="daLiangYongXueYuanYin" label="大量用血原因" />
        <MkColumn prop="leiJiShenQingLiang" label="累计申请量" />
        <MkColumnHead label="临床科主任审核">
          <MkColumn prop="keZhuShenHeRenId" label="审核人" width="80px" />
          <MkColumn prop="keZhuShenHeShiJian" label="审核时间" />
        </MkColumnHead>
        <MkColumnHead label="输血科审核">
          <MkColumn prop="shuXueKeShenHeRenId" label="审核人" width="80px" />
          <MkColumn prop="shuXueKeShenHeShiJian" label="审核时间" />
        </MkColumnHead>
        <MkColumnHead label="医务科审核">
          <MkColumn prop="yiWuKeShenHeRenId" label="审核人" width="80px" />
          <MkColumn prop="yiWuKeShenHeShiJian" label="审核时间" />
        </MkColumnHead>
      </MkTable>
      <MkPagination v-model:page="searchParam.page" v-model:pageSize="searchParam.pageSize" :total="total"
        @query="search" />
    </MkQueryContainer>
    <Edit ref="editRef" />
  </div>
</template>
<script lang="ts" setup name="QuXuePingZheng">
import Edit from './edit.vue'
import { TraPeiXueApi, TraPeiXueOutput } from '/@/api/tra/TraPeiXue';
import { usePageQuery } from '/@/hooks';


const { searchParam, total, tableData, loading, search } = usePageQuery<TraPeiXueOutput>(TraPeiXueApi.page);
const editRef = ref();

const edit = (row) => {
  console.log(row);
  editRef.value?.loadingEntity(row);
}
onMounted(() => {
  search()
})
</script>
<style lang="scss" scoped></style>
